#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include "unordered_map.h"
#include "unordered_set.h"

using namespace std;
void test_unordered_set1()
{
	The_Song_of_the_end_of_the_world::unordered_set<int> set;
	set.insert(1);
	set.insert(2);
	set.insert(3);
	set.insert(4);
	set.insert(5);
	set.insert(6);
	set.insert(7);
	auto it = set.begin();
	while (it!= set.end())
	{
		cout << *it << " ";
		++it;
	}
	cout << endl;
}
struct Date
{
	int _year;
	int _month;
	int _day;

	bool operator==(const Date& d) const
	{
		return _year == d._year
			&& _month == d._month
			&& _day == d._day;
	}
};

struct DateHashFunc
{
	// BKDR
	size_t operator()(const Date& d)
	{
		//2025 1 9
		//2025 9 1
		//2025 2 8
		size_t hash = 0;
		hash += d._year;
		hash *= 131;

		hash += d._month;
		hash *= 131;

		hash += d._day;
		hash *= 131;

		return hash;
	}
};
void test_unordered_set2()
{
	The_Song_of_the_end_of_the_world::unordered_set<Date, DateHashFunc> s1;
	s1.insert({ 2025, 9, 15 });
	s1.insert({ 2025, 9, 18 });
}
int main()
{
	test_unordered_set2();
	//test_unordered_map();
	return 0;
}